package com.zbkj.admin.controller.platform.v2;

import com.zbkj.admin.model.req.AdminQuotaListReq;
import com.zbkj.admin.model.req.WithdrawConfirmReq;
import com.zbkj.admin.model.req.WithdrawListReq;
import com.zbkj.service.model.vo.QuotaListVO;
import com.zbkj.admin.model.vo.WithdrawListVO;
import com.zbkj.admin.service.AdminFundV2Service;
import com.zbkj.dal.base.page.CommonPage;
import com.zbkj.dal.base.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api("管理员资金账户")
@RestController
@RequestMapping("/api/admin/platform/v2/fund")
public class PlatformFundV2Controller {

    @Resource
    private AdminFundV2Service adminFundV2Service;


    @ApiOperation(value = "提现列表")
    @GetMapping("/withdraw/list")
    public CommonResult<CommonPage<WithdrawListVO>> withdrawList(WithdrawListReq req) {
        return CommonResult.success(adminFundV2Service.withdrawList(req));
    }

    @ApiOperation(value = "提现列表导出")
    @GetMapping("/withdraw/export")
    public void withdrawExport(WithdrawListReq req) {
        adminFundV2Service.withdrawExport(req);
    }

    @ApiOperation(value = "提现结果确认")
    @PostMapping("/withdraw/confirm")
    public CommonResult<Void> withdrawConfirm(WithdrawConfirmReq req) {
        adminFundV2Service.withdrawConfirm(req);
        return CommonResult.success();
    }

    @ApiOperation(value = "用户等级计算额度流水", tags = "承享额度")
    @GetMapping("/quota/total/fund/flow")
    public CommonResult<CommonPage<QuotaListVO>> totalQuotaFundFlow(AdminQuotaListReq req) {
        return CommonResult.success(adminFundV2Service.totalQuotaFundFlow(req));
    }

    @ApiOperation(value = "用户可用额度流水", tags = "承享额度")
    @GetMapping("/quota/available/fund/flow")
    public CommonResult<CommonPage<QuotaListVO>> availableQuotaFundFlow(AdminQuotaListReq req) {
        return CommonResult.success(adminFundV2Service.availableQuotaFundFlow(req));
    }

}
